package com.hgkj.cloud.base.dao;

import com.hgkj.cloud.base.domain.EUser;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface EUserMapper {

    /* 新增用户*/
    int insertUser(EUser user);

    /* 更新用户信息*/
    int updateUser(EUser user);

    /* 重置用户密码*/
    int resetUserPwd(EUser user);

    /* 删除用户*/
    int delUserByUuid(String uuid);

    /* 物理删除用户*/
    int PhysicsDelUserByUuid(String uuid);
    /* 逻辑删除用户*/
    int delUserByFrameworkId(Map<String, Object> map);

    /* 获取用户信息*/
    EUser getUserInfo(Map<String, Object> map);
    EUser getUserInfoSimpleByName(Map<String, Object> map);

    EUser getBindUserInfo(Map<String, Object> map);

    Map<String, Object> getUserInfoSimple(String uuid);

    // 查询用户信息  ----注意：不管用户状态正常与否
    EUser getUserInfoByOnlyUuid(String uuid);

    /* 获取用户信息，包含最近一次使用设备时间*/
    EUser getUserInfoWithLastUse(Map<String, Object> map);

    List<EUser> listEUsersWithAppUsed();

    /* 查询用户列表*/
    List<EUser> listEUsers(Map<String, Object> map);

    /* 查询用户列表总数*/
    long listEUsersCount(Map<String, Object> map);

    /* 查询渠道用户列表总数*/
    List<Map<String, Object>> listChannelUsersCount(Map<String, Object> map);

    /* 查询私人可查看报告人员*/
    List<EUser> listPrivateEUsers(Map<String, Object> map);

    /* 查询读心仪私人可查看报告人员*/
    List<EUser> listBraceletDataPrivateEUsers(Map<String, Object> map);

    int listBraceletDataPrivateEUsersCount(Map<String, Object> map);

    /* 查询知心宝私人可查看报告人员*/
    List<EUser> listBraceletZxbPrivateEUsers(Map<String, Object> map);

    int listBraceletZxbPrivateEUsersCount(Map<String, Object> map);

    /* 查询床垫私人可查看报告人员*/
    List<EUser> listMattressPrivateEUsers(Map<String, Object> map);

    int listMattressPrivateEUsersCount(Map<String, Object> map);

    List<EUser> listMattressPrivateEUsers0(Map<String, Object> map);

    /* 查询单位可查看报告人员*/
    List<EUser> listTenantEUsers(Map<String, Object> map);

    /* 查询绑定设备列表*/
    List<Map<String, Object>> listReportViewer(Map<String, Object> map);

    // 关注人员列表 --不分type
    List<Map<String, Object>> listReportViewers(Map<String, Object> map);

    // 关注人员数量 --不分type
    int listReportViewersCount(Map<String, Object> map);

    List<EUser> listExamineUsersByGender(Map<String, Object> map);

    Map<String, Object> getAbnormalRiskUser(Map<String, Object> map);

    List<Map<String, Object>> listAllUser(Map<String, Object> map);

    List<EUser> listExamineUsers(Map<String, Object> map);

    int listExamineUsersCount(Map<String, Object> map);

    EUser getExamineUserInfo(Map<String, Object> map);

    int delUserByUuids(List<String> uuids);

    List<EUser> listUsers(Map<String, Object> map);

    long listUsersCount(Map<String, Object> map);

    List<EUser> listTableTaskUsers(Map<String, Object> map);

    long listTableTaskUsersCount(Map<String, Object> map);

    List<EUser> listQnTaskUsers(Map<String, Object> map);

    long listQnTaskUsersCount(Map<String, Object> map);

    List<String> listUserUuid(Map<String,Object> map);

    int updateUserChannelId(Map<String, Object> map);

    int updateUserBindAccount(EUser eUser);

    int disableUserByFrameworkId(Long frameworkId);

    List<EUser> listViewOrChannelRecentStatUsers(Map<String, Object> map);

    int listViewOrChannelRecentStatUsersCount(Map<String, Object> map);

    List<Map<String, Object>> getUserPush();

    void updateUserPush(EUser userInfo);

    void DelUserPush(String uuid);

    void updateUserByUserName(EUser pushUser);


    int deleteDisableUserByMap(Map<String, Object> map);

    int disableUserByUuid(String uuid);

    EUser getSyncUserInfo(Map<String, Object> map);

    int clearDataByMap(Map<String, Object> map);

    List<EUser> getAllUserByMap(Map<String, Object> map);

    void commit();
}
